﻿using System;
using System.Collections.Generic;
using UnityEngine;

namespace Elvex
{
    static class UpdateManager
    {
        private static List<Ticker> Tickers
        {
            get;
        } = new List<Ticker>();
        
        public static void AddTicker(Ticker ticker)
        {
            Tickers.Add(ticker);
        }

        public static void RemoveTicker(Ticker ticker)
        {
            Tickers.Remove(ticker);
        }

        public static void Update()
        {
            foreach( var item in Tickers)
            {
                item.Update(Time.deltaTime);
            }
        }
    }
}
